+Mon Sep 13 19:31:34 2004 Matthias Clasen <maclas@gmx.de>
+
+ * io-jpeg.c (real_save_jpeg): Drop the alpha channel
+ when saving 4-channel pixbufs. (#152450, Emmanuel Pacaud)
+
2004-09-09 Matthias Clasen <mclasen@redhat.com>
* makegdkpixbufalias.pl: Use the short prefix "IA__" for
int i, j;
int w, h = 0;
int rowstride = 0;
+ int n_channels;
struct error_handler_data jerr;
ToFunctionDestinationManager to_callback_destmgr;
}
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+ n_channels = gdk_pixbuf_get_n_channels (pixbuf);
w = gdk_pixbuf_get_width (pixbuf);
h = gdk_pixbuf_get_height (pixbuf);
while (cinfo.next_scanline < cinfo.image_height) {
/* convert scanline from ARGB to RGB packed */
for (j = 0; j < w; j++)
- memcpy (&(buf[j*3]), &(ptr[i*rowstride + j*3]), 3);
+ memcpy (&(buf[j*3]), &(ptr[i*rowstride + j*n_channels]), 3);
/* write scanline */
jbuf = (JSAMPROW *)(&buf);